#include <iostream>
#include <set>
using namespace std;
int main()
{
    int numList[6] = {1, 2, 2, 3, 3, 3};
    //1.set add
    set<int> numSet;
    for (int i = 0; i < 6; i++)
    {
        //2.1insert into set
        numSet.insert(numList[i]);
    }
    cout << *numSet.end() << endl;
    //2.travese set
    for (set<int>::iterator it = numSet.begin(); it != numSet.end(); it++)
    {
        cout << *it << " occurs " << endl;
    }
    //3.set find useage

    int findNum = 1;
    if (numSet.find(findNum) != numSet.end())
    {
        cout << "find num " << findNum << " in set" << endl;
    }
    else
    {
        cout << "do not find num in set" << findNum << endl;
    }
    //set delete useage
    int eraseReturn = numSet.erase(1);
    if (1 == eraseReturn)
    {
        cout << "erase num 1 success" << endl;
    }
    else
    {
        cout << "erase failed,erase num not in set" << endl;
    }
    return 0;
}